package com.shanzmoo.admin.domain.dto;

import cn.hutool.core.bean.BeanUtil;
import com.shanzmoo.base.bean.ValidList;
import com.shanzmoo.db.store.entity.StoreStockAllotBillEntity;

import java.time.LocalDateTime;
import java.io.Serializable;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.constraints.NotEmpty;


/**
 * 仓库调拨单 保存对象
 *
 * @author Gzhao 2021-03-11
 */
@Data
@ApiModel("仓库调拨单-保存对象")
public class StoreStockAllotBillSaveDTO implements Serializable {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "调入仓储用户ID")
    private Integer inMemberId;

    @ApiModelProperty(value = "调出仓储用户ID")
    private Integer outMemberId;

    @ApiModelProperty(value = "备注")
    private String remark;

    @NotEmpty(message = "商品明细不允许为空")
    @ApiModelProperty(value = "商品明细")
    private ValidList<StoreStockAllotBillDetailSaveDTO> detailList;

    public StoreStockAllotBillEntity convertEntity() {
        StoreStockAllotBillEntity target = new StoreStockAllotBillEntity();
        BeanUtil.copyProperties(this, target, true);
        return target;
    }
}
